﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


namespace Ianelli_Tactics.Map
{
    class _0_0
    {

        ContentManager Content;
        Texture2D background, ground;
        public List<Object> objects = new List<Object>();
        public List<Character> characters = new List<Character>();
        float bg_scale = 2f;



        public _0_0(ContentManager Content)
        {

            this.Content = Content;
            this.ground = Content.Load<Texture2D>("testemap");

        }

        public void Update(GameTime gameTime, MouseState mouse, MouseState old_mouse, KeyboardState keyboard, KeyboardState old_keyboard)
        {

            if(keyboard.IsKeyDown(Keys.P) && !old_keyboard.IsKeyDown(Keys.P))
            {
                characters.Add(new Character(Content,
            }

            foreach (Object object_ in objects)
            {
                object_.Update(gameTime);
            }

            foreach (Character char_ in characters)
            {
                char_.Update(gameTime, mouse, old_mouse, keyboard, old_keyboard);
            }

           
        }

        public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(
                ground, 
                new Vector2(),
                new Rectangle(0, 0, ground.Width, ground.Height),
                Color.White,
                0f,
                new Vector2(),
                bg_scale,
                SpriteEffects.None,
                0f
                );

            foreach (Object object_ in objects)
            {
                object_.Draw(gameTime, spriteBatch);
            }
        }

    }
}
